package com.shareyi.simpleserver.servlet.config;

import java.io.File;

import org.apache.commons.digester3.Digester;
import org.apache.commons.digester3.binder.DigesterLoader;


public class WebAppParseUtil {

	public static WebAppBean parseWebConfig(String webConfigPath) throws Exception {
		WebAppBean webAppBean=null;
		DigesterLoader loader = DigesterLoader.newLoader(new WebRuleModule());
		//防止配置文件数据重复
		 Digester digester=loader.newDigester();
		try {
			File file=new File(webConfigPath);
			webAppBean = digester.parse(file);
		} catch (Exception e) {
			throw new Exception("parse wox configuartion file failed", e);
		}
		
		 return webAppBean;

	}
}
